using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class NewProduct : System.Web.UI.UserControl
{
    processProduct pProduct;
    protected void Page_Load(object sender, EventArgs e)
    {
      //  string ProductTypeID = Request.QueryString["ProductTypeID"];
       // Response.Write(ProductTypeID.ToString());
        pProduct = new processProduct();
        dtlNewProduct.DataSource = pProduct.getNewProduct().Tables[0];
        dtlNewProduct.DataBind();
    }
    protected void dtlNewProduct_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        Label lblProductName = (Label)e.Item.FindControl("lblProductName");
        Label lblProductPrice = (Label)e.Item.FindControl("lblProductPrice");
        Label lblProductQuantity = (Label)e.Item.FindControl("lblProductQuantity");
        ImageButton imgProductImage = (ImageButton)e.Item.FindControl("imgProductDetail");
        HyperLink hplProductDetail = (HyperLink)e.Item.FindControl("hplProductDetail");        
        DataRowView row = (DataRowView)e.Item.DataItem;
        lblProductName.Text = row["ProductName"].ToString();
        lblProductPrice.Text = row["ProductPrice"].ToString();
        lblProductQuantity.Text = row["ProductQuantity"].ToString();
        imgProductImage.ImageUrl = "Images/" + row["ProductImage"].ToString();
       // imgProductImage.PostBackUrl = "index.aspx?subpara=productdetail&ProductID=" + ((DataRowView)e.Item.DataItem)["ProductID"].ToString();
        hplProductDetail.NavigateUrl = "index.aspx?subpara=productdetail&ProductID=" + ((DataRowView)e.Item.DataItem)["ProductID"].ToString();
        
    }
}
